if card field "word" is empty then put "A910" into card field "word"
end opencard
-- part 1 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=20 top=262 right=284 bottom=120
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Trap Name
----- HyperTalk script -----
on mouseUp
Put card field "word" into temp
put trapname(temp) into card field "name"
end mouseUp
-- part 2 (field)
-- low flags: 00
-- high flags: 2004
-- rect: left=129 top=260 right=283 bottom=209
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: word
----- HyperTalk script -----
on returninfield
click at loc of button "Trap Name"
end returninfield
on enterinfield
click at loc of button "Trap Name"
end enterinfield
-- part 3 (field)
-- low flags: 01
-- high flags: 2004
-- rect: left=230 top=260 right=284 bottom=398
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: name
-- part contents for background part 68
----- text -----
The TrapName XFCN takes a trap word as a parameter and returns the name of the corresponding trap. Try the demo below for examples. Note that this XFCN expects the entire trap word as a parameter.